/**
 * 用户表单
 */
import { ref } from 'vue'
import { FormItemProps } from '../../../components/base/form-item/props/index'
import { user } from '../../../entity/system/user'
export const formItems = ref<Array<FormItemProps<user>>>([
  {
    type: 'input',
    name: 'name',
    label: '用户名',
    placeholder: '请输入用户名',
    rules: [{ required: true, message: '请输入用户名' }],
  },
  {
    type: 'input',
    name: 'nickName',
    label: '昵称',
    placeholder: '昵称',
    rules: [{ required: true, message: '请输入昵称' }],
  },
  {
    type: 'input',
    name: 'mobile',
    label: '手机号',
    placeholder: '手机号',
    rules: [{ required: true, message: '请输入手机号' }],
  },
  {
    type: 'input',
    name: 'email',
    label: '邮箱',
    placeholder: '邮箱',
  },
  {
    type: 'select',
    name: 'deptId',
    label: '机构',
    placeholder: '机构',
    params: {
      fieldNames: { label: 'name', value: 'id' },
    },
  },
  {
    type: 'select',
    name: 'userRole',
    label: '角色',
    placeholder: '角色',
    params: {
      mode: 'multiple',
      // labelInValue: true,
      fieldNames: { label: 'name', value: 'id' },
    },
  },
  {
    type: 'input',
    name: 'password',
    label: '密码',
    placeholder: '密码',
    rules: [{ required: true, message: '请输入密码' }],
    params: {
      type: 'password',
    },
  },
  {
    type: 'switch',
    name: 'status',
    placeholder: '状态 0：禁用 1：正常 ',
    label: '状态',
    params: {
      checkedChildren: '正常',
      unCheckedChildren: '禁用',
      checkedValue: 1,
      unCheckedValue: 0,
    },
  },
  {
    type: 'upload',
    name: 'avatar',
    placeholder: '头像',
    label: '头像',
    params: {
      maxCount: 1,
      listType: 'picture-card',
    },
  },
  {
    type: 'select',
    name: 'userType',
    label: '类型',
    placeholder: '类型',
    value: 0,
    params: {
      options: [
        {
          label: '普通用户',
          value: 0,
        },
        {
          label: '管理员',
          value: 1,
        },
      ],
    },
  },
])
